<?php
/**
 * Created by PhpStorm.
 * User: yu
 * Date: 16-11-14
 * Time: 下午4:35
 */

namespace utils\sms;
use herosphp\core\Loader;


Loader::import('utils.sms.SmsBaoProvider');
Loader::import('utils.sms.YunPianProvider');
Loader::import('utils.sms.ChuangLanProvider');
Loader::import('utils.sms.Cr6868Provider');

class ProviderFactory
{
    //静态工厂方法
    public static function getProvider($type)
    {
        $provider = null;
        if ($type == "SmsBao") {
            $provider = new SmsBaoProvider();
            //print("初始化设置短信宝！");
        } elseif ($type == "YunPian") {
            $provider = new YunPianProvider();
            //print("初始化设置云片网！");
        }elseif ($type == "ChuangLan") {
            $provider = new ChuangLanProvider();
            //print("初始化设置创蓝网！");
        }elseif ($type == "Cr6868") {
            $provider = new Cr6868Provider();
            //print("初始化设置创瑞网！");
        }


        return $provider;
    }
}